<!--{include(file='head.html')}-->
<div id="wrap">
	<!--{include('left.html')}-->
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<form action="<!--{url('admin','user','usersave')}-->" method="post" name="submitform" id="submitform">
		<div id="main_c">
		<!--{if $opertype == "edit"}-->
			<ul class="bk">
				<li>
					<label><em>*</em>用户名：</label>
					<p>
						<!--{$user.uname}-->
					</p>
				</li>
				<li>
					<label><em>*</em>密码：</label>
					<p>
						<input class="input_tx" value="" name="pass" type="text" />
						(不修改密码，请留空)
					</p>
				</li>
			</ul>

			<ul class="bk">
				<li>
					<label>会员积分：</label>
					<p>
						<input class="input_tx" value="<!--{$user.point}-->" name="point" type="text" />
					</p>
				</li>
			</ul>

			<ul class="bk">
				<li>
					<label>姓名：</label>
					<p>
						<input class="input_tx" value="<!--{$user.name}-->" name="name" type="text" />
					</p>
				</li>
				<li>
					<label>Email：</label>
					<p>
						<input class="input_tx" value="<!--{$user.email}-->" name="email" type="text" />
					</p>
				</li>
				<li id="forrole">
					<label>联系方式：</label>
					<p>
						<input class="input_tx" value="<!--{$user.link}-->" name="link" type="text" />
					</p>
				</li>
			</ul>
			
			<ul class="bk">
				<li>
					<label>备注：</label>
					<p>
						<textarea name="note" id="note" class="text_tx"><!--{$user.note}--></textarea>
					</p>
				</li>
			</ul>
		<!--{elseif $opertype=="add"}-->
			<ul class="bk">
				<li>
					<label><em>*</em>用户名：</label>
					<p>
						<input class="input_tx" value="" name="uname" id="uname" type="text" 
							onfocus="$.htmlele.doaction(this,'focus')" onblur="$.htmlele.doaction(this,'blur')"/> 
						<span></span>
					</p>
				</li>
				<li>
					<label><em>*</em>密码：</label>
					<p>
						<input class="input_tx" value="" name="pass" id="pass" type="text" /> 
					</p>
				</li>
			</ul>

			<ul class="bk">
				<li>
					<label>会员积分：</label>
					<p>
						<input class="input_tx" value="0" name="point" type="text" />
					</p>
				</li>
			</ul>

			<ul class="bk">
				<li>
					<label>姓名：</label>
					<p>
						<input class="input_tx" value="" name="name" type="text" />
					</p>
				</li>
				<li>
					<label>Email：</label>
					<p>
						<input class="input_tx" value="" name="email" type="text" />
					</p>
				</li>
				<li>
					<label>联系方式：</label>
					<p>
						<input class="input_tx" value="" name="link" type="text"/>
					</p>
				</li>
			</ul>
			
			<ul class="bk">
				<li>
					<label>备注：</label>
					<p>
						<textarea name="note" id="note" class="text_tx"></textarea>
					</p>
				</li>
			</ul>
<script type="text/javascript">
(function($){
	$.htmlele = {
		obj	:null,
		hint:null,
		setObj:function(obj) {//设置对象
			this.obj	= $(obj);
			this.hint	= $(obj).next();
		},
		doaction:function(obj,dotype) {//操作
			this.setObj(obj);
			var objname = this.obj.attr("name");
			var func	= dotype + objname;
			if(!$.isFunction(this[func])) return ;
			this[func]();
		},
		bluruname:function() {//uname失去焦点
			var _this = this,
				uname = this.obj.val(),
				url   = "<!--{url('admin','user','checkuname')}-->";
			if(!uname) return ;
			$.post(url,{uname:uname},function(data) {
				if(data == 'success') {
					_this.hint.attr("class","htmlhints").text("用户名可用");
				} else if(data == "failure") {
					_this.hint.attr("class","htmlhinte").text("用户名不可用");
				} else {
					jAlert("发生错误,请刷新页面后重新执行该操作","警告");
				}
			});
		},
		focusuname:function() {//uname获取焦点
			this.hint.text('');
		}
	}
})(jQuery);
</script>
		<!--{/if}-->
			<div class="bt_bk2">
					<input type="hidden" value="<!--{$opertype}-->"		name="opertype" />
					<input type="hidden" value="<!--{def($uid)}-->"		name="uid" />
					<a href="javascript:void(0);" class="btn" onclick="jssubmit('user','<!--{$opertype}-->');return false;"><span>保存</span></a>
			</div>
		</div>
		</form>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
